home *** CD-ROM | disk | FTP | other *** search
- Path: news.th-darmstadt.de!news
- From: Enno Sandner <enno@intellektik.informatik.th-darmstadt.de>
- Newsgroups: comp.lang.c++
- Subject: Re: Nested Template Classes
- Date: Thu, 08 Feb 1996 09:50:20 +0100
- Organization: Fachbereich Informatik, TH Darmstadt
- Message-ID: <3119B94C.167EB0E7@intellektik.informatik.th-darmstadt.de>
- References: <4f6kql$70s@charnel.ecst.csuchico.edu: <ENNO.96Feb6180259@kitz.inferenzsysteme.informatik.th-darmstadt.de: <4f9nsa$ksj@charnel.ecst.csuchico.edu>
- NNTP-Posting-Host: kitz.intellektik.informatik.th-darmstadt.de
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0b6a (X11; I; SunOS 4.1.3 sun4m)
-
- James Robert McElroy wrote:
- >
- > In article <ENNO.96Feb6180259@kitz.inferenzsysteme.informatik.th-darmstadt.de:,
- > Enno Sandner <enno@inferenzsysteme.informatik.th-darmstadt.de: wrote:
- > :In article <4f6kql$70s@charnel.ecst.csuchico.edu: mcelroy@ecst.csuchico.edu (James Robert McElroy) writes:
- > :
- > :
- > :The 2nd solution is correct.
- > :
- > : Enno
- >
- > Really?! Hmmm... Borland 3.1 can't handle it. HP-UX does! G++
- > doesn't like it either. Is there a spec anywhere telling how to
- > handle this situation, (ANSI C++) or is it still undefined?
- >
-
- If you define a member-function outside its class-definition
- the function-name has to be qualified by its class-name.
- For instance the qualified class name of 'f' in the following
-
- template<class T> struct list { struct node { T f(); }; };
-
- class, is 'list<T> :: node'. Thus it's perfectly reasonable
- to define the function 'f' as:
-
- template<class T> T list<T> :: node :: f() { return T(); }
-
- IMO a complete formal argument can be deduced from the grammar
- given in the DWP.
- BTW neither gcc2.7.2 nor gcc2.6.3 have any problems with this code.
-
- Enno
-